// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package gadgettracermanager

import (
	context "context"

	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// GadgetTracerManagerClient is the client API for GadgetTracerManager service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type GadgetTracerManagerClient interface {
	// Methods called via kubectl-exec
	ReceiveStream(ctx context.Context, in *TracerID, opts ...grpc.CallOption) (GadgetTracerManager_ReceiveStreamClient, error)
	// Methods called by OCI Hooks
	AddContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*AddContainerResponse, error)
	RemoveContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*RemoveContainerResponse, error)
	// Methods called for debugging
	DumpState(ctx context.Context, in *DumpStateRequest, opts ...grpc.CallOption) (*Dump, error)
}

type gadgetTracerManagerClient struct {
	cc grpc.ClientConnInterface
}

func NewGadgetTracerManagerClient(cc grpc.ClientConnInterface) GadgetTracerManagerClient {
	return &gadgetTracerManagerClient{cc}
}

func (c *gadgetTracerManagerClient) ReceiveStream(ctx context.Context, in *TracerID, opts ...grpc.CallOption) (GadgetTracerManager_ReceiveStreamClient, error) {
	stream, err := c.cc.NewStream(ctx, &GadgetTracerManager_ServiceDesc.Streams[0], "/gadgettracermanager.GadgetTracerManager/ReceiveStream", opts...)
	if err != nil {
		return nil, err
	}
	x := &gadgetTracerManagerReceiveStreamClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type GadgetTracerManager_ReceiveStreamClient interface {
	Recv() (*StreamData, error)
	grpc.ClientStream
}

type gadgetTracerManagerReceiveStreamClient struct {
	grpc.ClientStream
}

func (x *gadgetTracerManagerReceiveStreamClient) Recv() (*StreamData, error) {
	m := new(StreamData)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *gadgetTracerManagerClient) AddContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*AddContainerResponse, error) {
	out := new(AddContainerResponse)
	err := c.cc.Invoke(ctx, "/gadgettracermanager.GadgetTracerManager/AddContainer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gadgetTracerManagerClient) RemoveContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*RemoveContainerResponse, error) {
	out := new(RemoveContainerResponse)
	err := c.cc.Invoke(ctx, "/gadgettracermanager.GadgetTracerManager/RemoveContainer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gadgetTracerManagerClient) DumpState(ctx context.Context, in *DumpStateRequest, opts ...grpc.CallOption) (*Dump, error) {
	out := new(Dump)
	err := c.cc.Invoke(ctx, "/gadgettracermanager.GadgetTracerManager/DumpState", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// GadgetTracerManagerServer is the server API for GadgetTracerManager service.
// All implementations must embed UnimplementedGadgetTracerManagerServer
// for forward compatibility
type GadgetTracerManagerServer interface {
	// Methods called via kubectl-exec
	ReceiveStream(*TracerID, GadgetTracerManager_ReceiveStreamServer) error
	// Methods called by OCI Hooks
	AddContainer(context.Context, *ContainerDefinition) (*AddContainerResponse, error)
	RemoveContainer(context.Context, *ContainerDefinition) (*RemoveContainerResponse, error)
	// Methods called for debugging
	DumpState(context.Context, *DumpStateRequest) (*Dump, error)
	mustEmbedUnimplementedGadgetTracerManagerServer()
}

// UnimplementedGadgetTracerManagerServer must be embedded to have forward compatible implementations.
type UnimplementedGadgetTracerManagerServer struct{}

func (UnimplementedGadgetTracerManagerServer) ReceiveStream(*TracerID, GadgetTracerManager_ReceiveStreamServer) error {
	return status.Errorf(codes.Unimplemented, "method ReceiveStream not implemented")
}

func (UnimplementedGadgetTracerManagerServer) AddContainer(context.Context, *ContainerDefinition) (*AddContainerResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddContainer not implemented")
}

func (UnimplementedGadgetTracerManagerServer) RemoveContainer(context.Context, *ContainerDefinition) (*RemoveContainerResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RemoveContainer not implemented")
}

func (UnimplementedGadgetTracerManagerServer) DumpState(context.Context, *DumpStateRequest) (*Dump, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DumpState not implemented")
}
func (UnimplementedGadgetTracerManagerServer) mustEmbedUnimplementedGadgetTracerManagerServer() {}

// UnsafeGadgetTracerManagerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GadgetTracerManagerServer will
// result in compilation errors.
type UnsafeGadgetTracerManagerServer interface {
	mustEmbedUnimplementedGadgetTracerManagerServer()
}

func RegisterGadgetTracerManagerServer(s grpc.ServiceRegistrar, srv GadgetTracerManagerServer) {
	s.RegisterService(&GadgetTracerManager_ServiceDesc, srv)
}

func _GadgetTracerManager_ReceiveStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(TracerID)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GadgetTracerManagerServer).ReceiveStream(m, &gadgetTracerManagerReceiveStreamServer{stream})
}

type GadgetTracerManager_ReceiveStreamServer interface {
	Send(*StreamData) error
	grpc.ServerStream
}

type gadgetTracerManagerReceiveStreamServer struct {
	grpc.ServerStream
}

func (x *gadgetTracerManagerReceiveStreamServer) Send(m *StreamData) error {
	return x.ServerStream.SendMsg(m)
}

func _GadgetTracerManager_AddContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ContainerDefinition)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GadgetTracerManagerServer).AddContainer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gadgettracermanager.GadgetTracerManager/AddContainer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GadgetTracerManagerServer).AddContainer(ctx, req.(*ContainerDefinition))
	}
	return interceptor(ctx, in, info, handler)
}

func _GadgetTracerManager_RemoveContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ContainerDefinition)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GadgetTracerManagerServer).RemoveContainer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gadgettracermanager.GadgetTracerManager/RemoveContainer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GadgetTracerManagerServer).RemoveContainer(ctx, req.(*ContainerDefinition))
	}
	return interceptor(ctx, in, info, handler)
}

func _GadgetTracerManager_DumpState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DumpStateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GadgetTracerManagerServer).DumpState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gadgettracermanager.GadgetTracerManager/DumpState",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GadgetTracerManagerServer).DumpState(ctx, req.(*DumpStateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// GadgetTracerManager_ServiceDesc is the grpc.ServiceDesc for GadgetTracerManager service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GadgetTracerManager_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gadgettracermanager.GadgetTracerManager",
	HandlerType: (*GadgetTracerManagerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddContainer",
			Handler:    _GadgetTracerManager_AddContainer_Handler,
		},
		{
			MethodName: "RemoveContainer",
			Handler:    _GadgetTracerManager_RemoveContainer_Handler,
		},
		{
			MethodName: "DumpState",
			Handler:    _GadgetTracerManager_DumpState_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ReceiveStream",
			Handler:       _GadgetTracerManager_ReceiveStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/gadgettracermanager.proto",
}
